<template>
  <div class="project-page">
    <div class="top-header"></div>
    <TopShow></TopShow>
    <div class="menu">
      <span>欢迎你朋友，下面所展示的是本人学习前端以来的项目经历，希望能帮到你</span>
    </div>
    <!-- 主体内容 -->
    <div class="container">
      <h3>我的项目></h3>
      <div class="content">
        <ProjectBox v-for="project in projectList" :key="project.id" :projectData="project"></ProjectBox>
      </div>
    </div>
  </div>
</template>

<script setup>
import { computed } from "vue"
import { useStore } from "vuex"
import TopShow from "./cpns/TopShow.vue"
import ProjectBox from "./cpns/ProjectBox.vue"
// 初始化数据
const store = useStore()
store.dispatch("project/getProjectListDataAction")
const projectList = computed(() => store.state.project.projectList)
</script>

<style scoped>
.top-header {
  height: 15px;
  background-image: linear-gradient(to right, #0772a6, #949b93);
}
.bgc {
  position: relative;
  top: -85px;
  width: 100%;
  height: 400px;
  box-shadow: 0 0 10px #666;
}
.bgc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.menu {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  line-height: 60px;
  text-align: center;
  background-color: #21252b;
}
.menu span {
  color: aliceblue;
  letter-spacing: 5px;
  font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 20px;
}
.container {
  padding: 20px 40px;
  background-color: #aaa;
}
.container h3 {
  margin-bottom: 20px;
}
.content {
  width: calc(100% - 40px);
}
</style>
